<%@ include file="/common/taglibs.jsp"%>

<head>
   <title><fmt:message key="cutDetailForm.heading"/></title>
    <meta name="heading" content="<fmt:message key='cutDetailForm.heading'/>"/>
      <meta name="menu" content="RoleAdminCut"/>
</head>
<div id="help">
    <h2>
        <a href="<c:url value='helpCutDetailForm.html?decorate=false'/>"
           title="Help material purchase"
           onclick="Modalbox.show(this.href, {title: this.title, width: 600}); return false;">
               <fmt:message key="help"/>
        </a>
    </h2>
</div>
<s:form id="cutDetailForm" action="saveCutDetail" method="post" validate="true">
    <s:hidden key="cutDetail.id" value="%{cutDetail.id}"/>

    <s:select label="%{getText('cutDetail.model')}" name="cutDetail.pantDesign.model.id"
              list="modelList" listKey="id" listValue="datas" required="true"
              headerKey="-1" headerValue="--- Please Select ---" />
    <s:select label="%{getText('cutDetail.modelSize')}" name="cutDetail.pantDesign.modelSize.id"
              list="modelSizeList" listKey="id" listValue="valueSize" required="true"
              headerKey="-1" headerValue="--- Please Select ---" />

    <s:select id="cutDetailMaterials" label="%{getText('asignationCut.typeMaterial')}"
              name="cutDetail.pantDesign.material.id" list="listMaterials"
              listKey="id" listValue="description" required="true" headerKey="-1" headerValue="--- Please Select ---" />

    <%--s:textfield key="cutDetail.quantity" cssClass="text medium" disabled="true"/--%>

    <s:hidden name="quantity"/>
    <s:hidden name="cutDetail.cutProcess.id"/>
    
    <li class="buttonBar bottom">
        <c:if test="${ empty cutDetail.id || cutDetail.modify}">
            <s:submit cssClass="button" method="saveCutDetail" key="button.save" theme="simple"/>
        </c:if>
        <c:if test="${ (not empty cutDetail.id) && !cutDetail.modify}">
            <s:submit cssClass="button" method="saveCutDetail" key="button.save" theme="simple" disabled="true" />
        </c:if>
        <input type="button" style="margin-right: 5px"
                             onclick="location.href='<c:url value="/addCutDetailToCutProcess.html"/>'"
                             value="<fmt:message key="button.cancel"/>"/>
    </li>
</s:form>

<script type="text/javascript">
    Form.focusFirstElement($("cutDetailForm"));
</script>